home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Produtividade / OpenOffice.org 2.0.1 / openofficeorg4.cab / utf_16_be.py < prev    next >
Text File  |  2005-11-19  |  730b  |  33 lines

  1. """ Python 'utf-16-be' Codec
  2.  
  3.  
  4. Written by Marc-Andre Lemburg (mal@lemburg.com).
  5.  
  6. (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
  7.  
  8. """
  9. import codecs
  10.  
  11. ### Codec APIs
  12.  
  13. class Codec(codecs.Codec):
  14.  
  15.     # Note: Binding these as C functions will result in the class not
  16.     # converting them to methods. This is intended.
  17.     encode = codecs.utf_16_be_encode
  18.     decode = codecs.utf_16_be_decode
  19.  
  20. class StreamWriter(Codec,codecs.StreamWriter):
  21.     pass
  22.  
  23. class StreamReader(Codec,codecs.StreamReader):
  24.  
  25.     def readline(self, size=None):
  26.         raise NotImplementedError, '.readline() is not implemented for UTF-16-BE'
  27.  
  28. ### encodings module API
  29.  
  30. def getregentry():
  31.  
  32.     return (Codec.encode,Codec.decode,StreamReader,StreamWriter)
  33.